<link rel="stylesheet" href="../addons/jy_h5game/resource/css/rank.css">
<div class="fui-page fui-page-current page-rank" style="overflow:auto;">
        <div class="fui-header">
            <div class="fui-header-left">
                <a class="back" href="javascript:history.back();"></a>
            </div>
            <div class="title">排行榜</div>
            <div class="fui-header-right">&nbsp;</div>
        </div>
		<div class='fui-content'>
			<div id="tab" class="fui-tab fui-tab-danger">
				<a class="external active" href="javascript:;" ng-click="access()">排行榜</a>
				<a class="external" href="javascript:;" ng-click="access_json(pagedata.award)">获奖名单</a>
				<a class="external" href="javascript:;" ng-click="access_json(pagedata.notice)">活动说明</a>
				<a class="external" href="javascript:;" ng-click="access_json(pagedata.info)">个人资料</a>
			</div>
		   <div class="rankhead" ng-if="pagedata.op=='rank'">
						<div class="head">
							<div class="child">
								<span>{{pagedata.score}}</span>
								<p class="text">我的得分</p>
							</div>
							<div class="child gold">
							  <!--  <span>{php echo $user['paiming']>=1000 ? '1000+' : $user['paiming']}</span> -->
							  <span> </span>
								<p class="text">我的名次</p>
							</div>
							<div class="child" ng-if="pagedata.item.isShowRegNum==2">
								<span>{{pagedata.playerNums}}</span>
								<p class="text">参与人数</p>
							</div>
						</div>
						<div class="title">得分排名为实时更新</div>
			</div>
			<div class="rankline">
					<div class="left"></div>
					<div class="right"></div>
					<div class="center"></div>
			</div>
			<div class="ranklist" ng-if="pagedata.op=='main'">
				<div class="main">
					<div class="line title">
						<div class="col">排名</div>
						<div class="col">头像</div>
						<div class="col">姓名</div>
						<div class="col">贡献</div>
					</div>
					 <div class="line" ng-repeat='item in pagedata.list'>
						 <div class="col">{{item.paiming}}</div>
						 <div class="col">
							 <div class="face"><img ng-src="{{item.member.avatar || '../core/resource/images/nopic.jpg'}}" /></div>
							 <div class="name">{{item.name}}</div>
						 </div>
						 <div class="col index-1">{{item.pmoney || '0.00'}}</div>
					 </div>
					<div id="container" ></div>
				</div>
			</div>
		</div>
</div>
<script>
scope.loading = true;  //状态标记
scope.isnodata = false;
scope.pagedata.list =[];
//滚动加载
scope.pagedata.params.keyword = ''
var page = 1;
scope.pagedata.getlist=function(type){
		if(type==1){
			page = 1;
			scope.pagedata.list =[];
		}else{
			if(scope.isnodata){
				return;
			}
		}
		var keyword = scope.pagedata.params.keyword 
		if(!keyword || keyword=="undefined" || keyword==0){
			   keyword = '';
		}
		scope.get('jy_smallquan/manager/getlist/page='+page+'&keyword='+keyword,
				function(data){			
				if(data.error !=1){
								for (var i=0;i<data.list.length;i++){
									scope.pagedata.list.push(data.list[i]);
								}
								if(page >1){
									$(".fui-card-list").animate({scrollTop:0},300);
								}
								if(data.list.length<1){
									scope.isnodata=true;
								}
								page++;
								scope.loading = false;
								scope.$evalAsync();
								//getmpmansory();
							}else{
								console.log('error!');
							};
			});
}

	scope.pagedata.getlist(1);




scope.pagedata.scroll_bottom=function(){
		scope.pagedata.getlist();
}
</script>